home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ASME's Mechanical Engine…ing Toolkit 1997 December
/
ASME's Mechanical Engineering Toolkit 1997 December.iso
/
intel
/
pas-8087.lzh
/
M8087.MAC
next >
Wrap
Text File
|
1987-01-27
|
7KB
|
640 lines
;*****************************************************************************
; BYTE MAGAZINE AUGUST 1983 PAGE 331
;*****************************************************************************
; ************ M8087.MAC ************
;*****************************************************************************
; FILE OF 8087 MACROS FOR ASSEMBLY LANGUAGE SUPPORT
;*****************************************************************************
;********************** PAGE 334 **************************
if1
ESC_REG MACRO PARAM,REG
IFE REG
ESC PARAM,AX
ELSE
REG = REG - 1
IFE REG
ESC PARAM,CX
ELSE
REG = REG - 1
IFE REG
ESC PARAM,DX
ELSE
REG = REG - 1
IFE REG
ESC PARAM,BX
ELSE
REG = REG - 1
IFE REG
ESC PARAM,SP
ELSE
REG = REG - 1
IFE REG
ESC PARAM,BP
ELSE
REG = REG - 1
IFE REG
ESC PARAM,SI
ELSE
ESC PARAM,DI
ENDIF
ENDIF
ENDIF
ENDIF
ENDIF
ENDIF
ENDIF
ENDM
CHECK_ST MACRO P_ST
REG = -1
IFIDN <&P_ST>,<ST(0)>
REG = 0
ENDIF
IFIDN <&P_ST>,<ST(1)>
REG = 1
ENDIF
IFIDN <&P_ST>,<ST(2>
REG = 2
ENDIF
IFIDN <&P_ST>,<ST(3)>
REG = 3
ENDIF
IFIDN <&P_ST>,<ST(4)>
REG = 4
ENDIF
IFIDN <&P_ST>,<ST(5)>
REG = 5
ENDIF
IFIDN <&P_ST>,<ST(6)>
REG = 6
ENDIF
IFIDN <&P_ST>,<ST(7)>
REG = 7
ENDIF
IFIDN <&P_ST>,<st(0)>
REG = 0
ENDIF
IFIDN <&P_ST>,<st(1)>
REG = 1
ENDIF
IFIDN <&P_ST>,<st(2)>
REG = 2
ENDIF
IFIDN <&P_ST>,<st(3)>
REG = 3
ENDIF
IFIDN <&P_ST>,<st(4)>
REG = 4
ENDIF
IFIDN <&P_ST>,<st(5)>
REG = 5
ENDIF
IFIDN <&P_ST>,<st(6)>
REG = 6
ENDIF
IFIDN <&P_ST>,<st(7)>
REG = 7
ENDIF
IFIDN <&P_ST>,<ST(i)>
REG = 0
ENDIF
IFIDN <&P_ST>,<ST(I)>
REG = 0
;****************** PAGE 339 ********************
ENDIF
IFIDN <&P_ST>,<st(i)>
REG = 0
ENDIF
IFIDN <&P_ST>,<st(I)>
REG = 0
ENDIF
ENDM
CHK_CONC MACRO
IF AUTOSYNC
WAIT
ENDIF
ENDM
CHOOSE_4 MACRO P1,P2,XXX1,XXX2,XXX3,XXX4
ZERO = 0
NOTZERO = 0
REG = 0
IFB <P1>
REG = 1
ESC_REG XXX1,REG
ELSE
IFIDN <P1>,<ST>
CHECK_ST P2
ZERO = REG + 1
IFE ZERO
REG = 1
ENDIF
ESC_REG XXX2,REG
ELSE
IFIDN <P1>,<st>
CHECK_ST P2
ZERO = REG + 1
IFE ZERO
REG = 1
ENDIF
ESC_REG XXX2,REG
ELSE
CHECK_ST P1
NOTZERO = REG + 1
IF NOTZERO
ESC_REG XXX1,REG
ELSE
IFIDN <P1>,<SHORT>
ESC XXX3,P2
CHK_CONC
ELSE
IFIDN <P1>,<short>
ESC XXX3,P2
CHK_CONC
ELSE
IFIDN <P1>,<LONG>
ESC XXX4,P2
CHK_CONC
ELSE
IFIDN <P1>,<long>
ESC XXX4,P2
CHK_CONC
ELSE
;******************* PAGE 340 ************************
IFIDN <P1>,<TEMP>
ESC XXX2,P2
CHK_CONC
ELSE
IFIDN <P1>,<temp>
ESC XXX2,P2
CHK_CONC
ELSE
REG = 1
ESC XXX2,REG
ENDIF
ENDIF
ENDIF
ENDIF
ENDIF
ENDIF
ENDIF
ENDIF
ENDIF
ENDIF
ENDM
INT_SIZE MACRO P1,P2,XXX_S,XXX_W,XXX_L
IFIDN <P1>,<WORD>
ESC XXX_W,P2
ELSE
IFIDN <P1>,<word>
ESC XXX_W,P2
ELSE
IFIDN <P1>,<SHORT>
ESC XXX_S,P2
ELSE
IFIDN <P1>,<short>
ESC XXX_S,P2
ELSE
IFIDN <P1>,<LONG>
ESC XXX_L,P2
ELSE
IFIDN <P1>,<long>
ESC XXX_L,P2
ELSE
ERROR IN macro !!!
ENDIF
ENDIF
ENDIF
ENDIF
ENDIF
ENDIF
CHK_CONC
ENDM
FABS MACRO
WAIT
ESC 0CH,CX
ENDM
FADD MACRO P1,P2
IFB <P1>
FADDP ST(1),ST
ELSE
WAIT
CHOOSE_4 P1,P2,20H,00H,00H,20H
ENDIF
ENDM
FADDP MACRO P1,P2
WAIT
CHOOSE_4 P1,,30H
ENDM
FBLD MACRO P1
WAIT
ESC 3CH,P1
ENDM
FBSTP MACRO P1
WAIT
ESC 3EH,P1
ENDM
FCHS MACRO
WAIT
ESC 0CH,AX
;************************** PAGE 342 ************************
ENDM
FCLEX MACRO
WAIT
FNCLEX
ENDM
FCOM MACRO P1,P2
WAIT
CHOOSE_4 P1,P2,02H,,02H,22H
ENDM
FCOMP MACRO P1,P2
WAIT
CHOOSE_4 P1,P2,03H,,03H,23H
ENDM
FCOMPP MACRO
WAIT
ESC 33H,CX
ENDM
FDECSTP MACRO
WAIT
ESC 0EH,SI
ENDM
FDISI MACRO
WAIT
FNDISI
ENDM
FDIV MACRO P1,P2
IFB <P1>
FDIVP ST(1),ST
ELSE
WAIT
CHOOSE_4 P1,P2,26H,06H,06H,26H
ENDIF
ENDM
FDIVP MACRO P1,P2
WAIT
CHOOSE_4 P1,,36H
ENDM
FDIVR MACRO P1,P2
IFB <P1>
FDIVRP ST(1),ST
ELSE
WAIT
CHOOSE_4 P1,P2,27H,07H,07H,27H
ENDIF
ENDM
FDIVRP MACRO P1,P2
WAIT
CHOOSE_4 P1,,37H
ENDM
FENI MACRO
WAIT
FNENI
ENDM
FFREE MACRO P1
WAIT
CHOOSE_4 P1,,28H
ENDM
FIADD MACRO P1,P2
WAIT
INT_SIZE P1,P2,10H,30H
ENDM
FICOM MACRO P1,P2
WAIT
INT_SIZE P1,P2,12H,32H
ENDM
FICOMP MACRO P1,P2
WAIT
INT_SIZE P1,P2,13H,33H
ENDM
FIDIV MACRO P1,P2
WAIT
INT_SIZE P1,P2,16H,36H
ENDM
FIDIVR MACRO P1,P2
WAIT
INT_SIZE P1,P2,17H,37H
ENDM
FILD MACRO P1,P2
WAIT
INT_SIZE P1,P2,18H,38H,3DH
ENDM
FIMUL MACRO P1,P2
WAIT
INT_SIZE P1,P2,11H,31H
ENDM
FINCSTP MACRO
WAIT
ESC 0EH,DI
ENDM
FINIT MACRO
WAIT
FNINIT
ENDM
FIST MACRO P1,P2
WAIT
INT_SIZE P1,P2,1AH,3AH
ENDM
FISTP MACRO P1,P2
WAIT
;******************** PAGE 347 **************************
INT_SIZE P1,P2,1BH,3BH,3FH
ENDM
FISUB MACRO P1,P2
WAIT
INT_SIZE P1,P2,14H,34H
ENDM
FISUBR MACRO P1,P2
WAIT
INT_SIZE P1,P2,15H,35H
ENDM
FLD MACRO P1,P2
WAIT
CHOOSE_4 P1,P2,08H,1DH,08H,28H
ENDM
FLDCW MACRO P1
WAIT
ESC 0DH,P1
ENDM
FLDENV MACRO P1
WAIT
ESC 0CH,P1
ENDM
FLDLG2 MACRO
WAIT
ESC 0DH,SP
ENDM
FLDLN2 MACRO
WAIT
ESC 0DH,BP
ENDM
FLDL2E MACRO
WAIT
ESC 0DH,DX
ENDM
FLDL2T MACRO
WAIT
ESC 0DH,CX
ENDM
FLDPI MACRO
WAIT
ESC 0DH,BX
ENDM
FLDZ MACRO
WAIT
ESC 0DH,SI
ENDM
FLD1 MACRO
WAIT
ESC 0DH,AX
ENDM
FMUL MACRO P1,P2
IFB <P1>
FMULP ST(1),ST
ELSE
WAIT
CHOOSE_4 P1,P2,21H,01H,01H,21H
ENDIF
ENDM
FMULP MACRO P1,P2
WAIT
CHOOSE_4 P1,,31H
ENDM
FNCLEX MACRO
ESC 1CH,DX
ENDM
FNDISI MACRO
ESC 1CH,CX
ENDM
FNENI MACRO
ESC 1CH,AX
ENDM
FNINIT MACRO
ESC 1CH,BX
ENDM
FNOP MACRO
WAIT
ESC 0AH,AX
ENDM
FNSAVE MACRO P1
ESC 2EH,P1
ENDM
FNSTCW MACRO P1
ESC 0FH,P1
ENDM
FNSTENV MACRO P1
ESC 0EH,P1
ENDM
FNSTSW MACRO P1
ESC 2FH,P1
ENDM
FPATAN MACRO
WAIT
ESC 0EH,BX
ENDM
FPREM MACRO
WAIT
ESC 0FH,AX
ENDM
;********************** PAGE 348 *********************
FPTAN MACRO
WAIT
ESC 0EH,DX
ENDM
FRNDINT MACRO
WAIT
ESC 0FH,SP
ENDM
FRSTOR MACRO P1
WAIT
ESC 2CH,P1
ENDM
FSAVE MACRO P1
WAIT
FNSAVE P1
ENDM
FSCALE MACRO
WAIT
ESC 0FH,BP
ENDM
FSQRT MACRO
WAIT
ESC 0FH,DX
ENDM
FST MACRO P1,P2
WAIT
CHOOSE_4 P1,P2,2AH,,0AH,2AH
ENDM
FSTCW MACRO P1
WAIT
FNSTCW P1
ENDM
FSTENV MACRO P1
WAIT
FNSTENV P1
ENDM
FSTP MACRO P1,P2
WAIT
CHOOSE_4 P1,P2,2BH,1FH,0BH,2BH
ENDM
FSTSW MACRO P1
WAIT
FNSTSW P1
ENDM
FSUB MACRO P1,P2
IFB <P1>
FSUBP ST(1),ST
ELSE
WAIT
CHOOSE_4 P1,P2,24H,04H,04H,24H
ENDIF
ENDM
FSUBP MACRO P1,P2
WAIT
CHOOSE_4 P1,,34H
ENDM
FSUBR MACRO P1,P2
IFB <P1>
FSUBRP ST(1),ST
ELSE
WAIT
CHOOSE_4 P1,P2,25H,05H,05H,25H
ENDIF
ENDM
FSUBRP MACRO P1,P2
WAIT
CHOOSE_4 P1,,35H
ENDM
FTST MACRO
WAIT
ESC 0CH,SP
ENDM
FWAIT MACRO
WAIT
ENDM
FXAM MACRO
WAIT
ESC 0CH,BP
ENDM
FXCH MACRO P1
WAIT
CHOOSE_4 P1,,09H
ENDM
FXTRACT MACRO
WAIT
ESC 0EH,SP
ENDM
FYL2X MACRO
WAIT
ESC 0EH,CX
ENDM
FYL2XP1 MACRO
WAIT
ESC 0FH,CX
ENDM
F2XM1 MACRO
WAIT
ESC 0EH,AX
ENDM
ENDIF
AUTOSYNC = 1
;***************************************************************************
; ************ END OF 8087 MACROS **************
;***************************************************************************
*********** END OF 8087 MACROS **************
;*********************************************************************